package ui.frame.dialog.panel;

import static constants.GTextbookConstants.*;


import java.awt.Dimension;
import java.util.Vector;

import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;

public class ListPanel extends JPanel{
	
	public ListPanel(String englishName, String chineseName, Vector<String> items, int language){
		
		this.items = items;
		comboBox = new JComboBox(items);
		//set the look of components
        if(language == English){
        	label = new JLabel(englishName,SwingConstants.RIGHT);
        	label.setFont(Label_English_Font);
        	label.setPreferredSize(Label_English_Dimension);
        	
        }
        if(language == Chinese){
        	label = new JLabel(chineseName,SwingConstants.RIGHT);
        	label.setFont(Label_Chinese_Font);
        	label.setPreferredSize(Label_Chinese_Dimension);
        }
        comboBox.setPreferredSize(ComboBox_Dimension);
        comboBox.setEditable(true);
		add(label);		
		add(comboBox);
	}
	
	
	
	public JComboBox getComboBox() {
		return comboBox;
	}
	public void setComboBox(JComboBox comboBox) {
		this.comboBox = comboBox;
	}

	private JLabel label;
	private JComboBox comboBox;
	private Vector<String> items;
	public Vector<String> getItems() {
		return items;
	}
	public void setItems(Vector<String> items) {
		this.items = items;
	}
	
	public void setSize(Dimension size){
		this.comboBox.setPreferredSize(size);
	}
}
